﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manager/Base.Master" AutoEventWireup="true" CodeBehind="UserRight.aspx.cs" Inherits="YXQ.Manager.Manager.UserRight" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript">
        $(function () {
            $("#tree").tree({
                url: "../Handler/AdminHandler.ashx?OpType=Menu&UId=<%=reqID%>",
                //data: [
                //    { "id": 1, "text": "工程管理", "icos": null, "check": [], "state": "closed", "children": null },
                //    { "id": 10, "text": "基础数据", "icos": null, "check": null, "state": "closed", "children": null }
                //],
                
                checkbox: true,
                animate:true
               
            });
        })
        function getchk() {
            var sels = $("#tree").tree('getChecked');
            var s = '';
            for (var i = 0; i < sels.length; i++) {
                if (s != '') s += ',';
                s += sels[i].id;
            }
            $("#<%=hfRight.ClientID%>").val(s);
            var obj = document.getElementsByName('chkdp');  //选择所有name="'test'"的对象，返回数组     
               //取到对象数组后，我们来循环检测它是不是被选中     
             var s1='';    
              for(var i=0; i<obj.length; i++){    
                  if (obj[i].checked) s1 += obj[i].value + ',';  //如果选中，将value添加到变量s中     
                 }    
              $("#<%=hfDepartId.ClientID%>").val(s1);
        }
        
    </script>

    <input type="hidden" id="hfid" runat="server" datafield="hfId" />
   <div id="tbDetail">
    <div style="width:200px;border:1px solid #0094ff;height:300px;margin-top:20px;margin-left:20px;float:left;padding-left:20px;padding-top:10px;">
        <div style="margin:0px 0px 10px 0px">设置用户《<asp:Literal ID="ltrUName" runat="server"></asp:Literal>》的权限</div>
        <div id="tree" class="easyui-tree"></div>
        <br/>
       
     </div>
       <div style="width:200px;border:1px solid #0094ff;height:300px;margin-top:20px;margin-left:20px; float:left;padding-left:20px;padding-top:10px;">
            <div style="margin:0px 0px 10px 0px">所属部门</div>
            <asp:Literal ID="ltrDepart" runat="server"></asp:Literal>
       </div>
    <div style="clear:both;margin-top:30px; margin-left:20px;">      
         <input type="hidden" id="hfRight" runat="server" datafield="MudleId" />
        <input type="hidden" id="hfDepartId" runat="server" datafield="DepartId" />
        <br/>
         <input type="button" class="bt_wb1" onclick="getchk(); YXQ.Manager.SaveUserRight()" value="保存" />&nbsp;&nbsp;<input type="button" value="关闭" class="bt_wb1" onclick="    YXQ.Manager.CloseDialog();" />

        </div>
       </div>
</asp:Content>
